package com.netease.pris.activity.view.WebViews;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.webkit.WebView;
import com.netease.image.c;
import com.netease.imageex.a.a;
import com.netease.pris.activity.view.f;
import java.lang.reflect.Method;

public class WebViewV8 extends WebViewAdapter
{
  private static final int p = 0;
  private static final int q = 1;
  private static final int r = 2;
  private static final int s = 3;
  private int c = -1;
  private int d = -1;
  private int e = -1;
  private int f = -1;
  private int g;
  private Drawable h;
  private Drawable i;
  private float j = 0.0F;
  private float k = 0.0F;
  private float l = 0.0F;
  private float m = 0.0F;
  private float n = 0.0F;
  private float o = 0.0F;
  private int t = 0;
  private boolean u = false;
  private Rect v = new Rect();
  private Rect w = new Rect();
  private int x = 0;

  public WebViewV8(Context paramContext)
  {
    super(paramContext);
    a(paramContext);
  }

  public WebViewV8(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    a(paramContext);
  }

  public WebViewV8(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    a(paramContext);
  }

  private void a(Context paramContext)
  {
    int i1 = ViewConfiguration.get(paramContext).getScaledTouchSlop();
    this.g = (i1 * i1);
    this.x = c.a(paramContext, 25.0F);
  }

  private void a(Canvas paramCanvas)
  {
    if (this.h == null)
      this.h = getContext().getResources().getDrawable(2130837824);
    int i1 = a(this.c);
    int i2 = a(this.d);
    int i3 = a(this.e);
    int i4 = a(this.f);
    int i5 = i1 - 3 * this.h.getIntrinsicWidth() / 4;
    int i6 = d(i2);
    this.h.setBounds(i5, i6, i5 + this.h.getIntrinsicWidth(), i6 + this.h.getIntrinsicHeight());
    this.v.setEmpty();
    this.v.set(this.h.getBounds());
    if (this.i == null)
      this.i = getContext().getResources().getDrawable(2130837825);
    int i7 = i3 - this.i.getIntrinsicWidth() / 4;
    int i8 = e(i4);
    this.i.setBounds(i7, i8, i7 + this.i.getIntrinsicWidth(), i8 + this.i.getIntrinsicHeight());
    this.w.setEmpty();
    this.w.set(this.i.getBounds());
    this.h.draw(paramCanvas);
    this.i.draw(paramCanvas);
    this.i.getBounds();
    this.h.getBounds();
  }

  private int b(int paramInt)
  {
    return Math.round(paramInt * (1.0F / getScale()));
  }

  private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (((paramInt2 == paramInt4) && (paramInt1 < paramInt3)) || (paramInt4 > paramInt2));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  private int c(int paramInt)
  {
    return b(paramInt - b());
  }

  private int d(int paramInt)
  {
    if (paramInt < getScrollY())
      paramInt = getScrollY();
    return paramInt;
  }

  private int e(int paramInt)
  {
    if (paramInt < getScrollY())
      paramInt = getScrollY();
    return paramInt;
  }

  private boolean r()
  {
    if ((this.c != -1) || (this.d != -1) || (this.e != -1) || (this.f != -1));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  int a(int paramInt)
  {
    return Math.round(paramInt * getScale());
  }

  public void a()
  {
    emulateShiftHeld();
    f();
  }

  protected int b()
  {
    Method localMethod = null;
    if (0 == 0);
    try
    {
      localMethod = WebView.class.getDeclaredMethod("getTitleHeight", new Class[0]);
      localMethod.setAccessible(true);
      int i2 = ((Integer)localMethod.invoke(this, new Object[0])).intValue();
      i1 = i2;
      return i1;
    }
    catch (Exception localException)
    {
      while (true)
        int i1 = 0;
    }
  }

  public boolean c()
  {
    if ((this.n != 0.0F) && (this.o != 0.0F));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public void d()
  {
    h();
    k();
  }

  public boolean e()
  {
    return m();
  }

  public void k()
  {
    super.k();
    this.n = 0.0F;
    this.o = 0.0F;
    this.c = -1;
    this.d = -1;
    this.e = -1;
    this.f = -1;
    this.t = 0;
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    if ((m()) && (c()))
      a(paramCanvas);
  }

  public boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    a locala = a.a(paramMotionEvent);
    int i1;
    int i2;
    int i3;
    if ((m()) && (locala.a() == 1))
    {
      i1 = locala.b();
      this.l = (locala.c() + getScrollX());
      this.m = (locala.d() + getScrollY());
      float f1 = this.j - this.l;
      float f2 = this.k - this.m;
      i2 = (int)f1;
      i3 = (int)f2;
    }
    boolean bool;
    switch (i1)
    {
    default:
      bool = super.onTouchEvent(paramMotionEvent);
      return bool;
    case 0:
      this.u = false;
      this.n = this.l;
      this.o = this.m;
      this.j = this.n;
      this.k = this.o;
      this.t = 0;
      if (r())
      {
        if (this.t == 0)
          this.t = 1;
        if (!this.v.contains((int)this.l, (int)this.m))
          break label219;
        this.t = 2;
      }
      while (true)
      {
        bool = true;
        break;
        if (!this.w.contains((int)this.l, (int)this.m))
          continue;
        this.t = 3;
      }
    case 2:
      label219: if (i2 * i2 + i3 * i3 >= this.g)
      {
        this.u = true;
        if (this.t != 0)
          break label374;
        this.c = b((int)this.n);
        this.d = c((int)this.o);
        this.e = b((int)this.l);
        this.f = c((int)this.m);
        a(this.c, this.d, this.e, this.f);
      }
      while (true)
      {
        this.j = this.l;
        this.k = this.m;
        invalidate();
        bool = true;
        break;
        label374: if (this.t == 1)
        {
          a(this.c, this.d, this.e, this.f);
          continue;
        }
        if (this.t == 2)
        {
          int i21 = b((int)this.l);
          int i22 = c((int)this.m - this.h.getIntrinsicHeight() / 2);
          if (b(this.e, this.f, i21, i22))
          {
            this.c = this.e;
            this.d = this.f;
            this.e = i21;
            this.f = i22;
            a(this.c, this.d, this.e, this.f);
            this.t = 3;
            continue;
          }
          this.c = i21;
          this.d = i22;
          a(this.c, this.d, this.e, this.f);
          continue;
        }
        if (this.t != 3)
          continue;
        int i19 = b((int)this.l);
        int i20 = c((int)this.m - this.i.getIntrinsicHeight() / 2);
        if (b(this.c, this.d, i19, i20))
        {
          this.e = i19;
          this.f = i20;
          a(this.c, this.d, this.e, this.f);
          continue;
        }
        this.e = this.c;
        this.f = this.d;
        this.c = i19;
        this.d = i20;
        this.t = 2;
        a(this.c, this.d, this.c, this.d);
      }
    case 1:
    case 3:
    }
    int i4 = b((int)this.l);
    int i5 = c((int)this.m);
    int i17;
    int i18;
    if (r())
      if ((this.t == 2) || (this.t == 3))
        if (this.u)
        {
          i17 = this.e;
          i18 = this.f;
          label769: a(this.c, this.d, i17, i18);
        }
    do
      while (true)
      {
        this.j = this.l;
        this.k = this.m;
        invalidate();
        int[] arrayOfInt = new int[2];
        getLocationInWindow(arrayOfInt);
        int i10 = a(this.c);
        int i11 = a(this.d);
        int i12 = a(this.e);
        int i13 = a(this.f);
        int i14 = (i10 + i12) / 2 - getScrollX();
        int i15 = i11 - getScrollY() - this.x;
        int i16 = i13 + arrayOfInt[1] - getScrollY() + this.x;
        this.a.a(this, i14, i15, i16, 0);
        bool = true;
        break;
        i17 = b((int)this.l);
        i18 = c((int)this.m);
        this.e = i17;
        this.f = i18;
        break label769;
        if ((this.t != 1) || (this.u))
          continue;
        if (b(this.c, this.d, i4, i5))
        {
          a(this.c, this.d, i4, i5);
          this.e = i4;
          this.f = i5;
          continue;
        }
        a(i4, i5, this.c, this.d);
        this.e = this.c;
        this.f = this.d;
        this.c = i4;
        this.d = i5;
      }
    while (this.t != 0);
    int i6 = b((int)this.n);
    int i7 = c((int)this.o);
    int i8 = b((int)this.l);
    int i9 = c((int)this.m);
    if (!this.u)
    {
      if (!b(i6, i7, i8, i9))
        break label1192;
      this.c = i6;
      this.d = i7;
      this.e = i8;
    }
    for (this.f = i9; ; this.f = i7)
    {
      a(this.c, this.d, this.e, this.f);
      break;
      label1192: this.c = i8;
      this.d = i9;
      this.e = i6;
    }
  }

  public void onWindowFocusChanged(boolean paramBoolean)
  {
    if ((m()) && (c()) && (this.a != null))
      paramBoolean = true;
    super.onWindowFocusChanged(paramBoolean);
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.WebViews.WebViewV8
 * JD-Core Version:    0.6.0
 */